<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./public/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./public/js/jquery-3.1.1.min.js"></script>
<title>标题描述</title>
<style>
.body {
	margin: 50px;
	padding-left: 200px;
	padding-right: 200px;
}
</style>
</head>
<body class="body">
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title">提交标题描述</h3>
		</div>
		<div class="panel-body">
			<p class="text-center">提交关键字流程→设置价格→确认和提交→成功</p>
			<p>每次最多提交20个关键字,若你希望继续添加请分次提交(您已经提交了一个关键字)
			</p>
			
		</div>
		<table class="table table-striped table-bordered table-hover">
			<tbody>
			<tr>
			<td align="center" colspan="2">
			<input type="button" value="下一步" onclick="javascrtpt:window.location.href='price'">
			</td>
			</tr>
				<tr>
					<td>关键字</td>
					<td><input type="text" style="width: 500px" name="guan" id="guan" >
						<select id="grad">
							
					</select>最多写32个字</td>
				</tr>
				<tr>
					<td>网页标题</td>
					<td><input type="text" style="width: 350px" name="biao" id="biao">最多写20个字</td>
				</tr>
				<tr>
					<td>url地址</td>
					<td>http://<input style="width: 420px" type="text" name="x_url" id="x_url"></td>
				</tr>
				<tr>
					<td>网页描述</td>
					<td><input style="width: 650px;height: 180px;" type="text" name="miao" id="miao">最多一百字</td>
				</tr>
			</tbody>
		</table>
		<div class="panel-footer" style="padding-bottom: 28px">
			<button id="butt">复制</button>点击复制,可以将文本框内容复制到下个添加框中
		</div>
		
		<table class="table table-striped table-bordered table-hover">
			<tbody>
				<tr>
					<td>关键字</td>
					<td><input type="text" style="width: 500px" name="guan" id="guan1">
						<select id="grad1">
							
					</select>最多写32个字</td>
				</tr>
				<tr>
					<td>网页标题</td>
					<td><input type="text" style="width: 350px" name="biao" id="biao1">最多写20个字</td>
				</tr>
				<tr>
					<td>url地址</td>
					<td>http://<input style="width: 420px" type="text" name="x_url" id="x_url1"></td>
				</tr>
				<tr>
					<td>网页描述</td>
					<td><input style="width: 650px;height: 180px;" type="text" name="miao" id="miao1">最多一百字</td>
				</tr>
			</tbody>
		</table>
		<div class="panel-footer" style="padding-bottom: 28px">
			<button id="butt1">复制</button>点击复制,可以将文本框内容复制到下个添加框中
		</div>
		<table class="table table-striped table-bordered table-hover">
			<tbody>
				<tr>
					<td>关键字</td>
					<td><input type="text" style="width: 500px" name="guan" id="guan2">
						<select id="grad2">
							
					</select>最多写32个字</td>
				</tr>
				<tr>
					<td>网页标题</td>
					<td><input type="text" style="width: 350px" name="biao" id="biao2">最多写20个字</td>
				</tr>
				<tr>
					<td>url地址</td>
					<td>http://<input style="width: 420px" type="text" name="x_url" id="x_url2"></td>
				</tr>
				<tr>
					<td>网页描述</td>
					<td><input style="width: 650px;height: 180px;" type="text" name="miao" id="miao2">最多一百字</td>
				</tr>
			</tbody>
		</table>
		<div class="panel-footer" style="padding-bottom: 28px">
			<button>复制</button>点击复制,可以将文本框内容复制到下个添加框中
		</div>
	</div>
	
	<script src="./public/js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript">

$(document).ready(function () {

$("#guan").change(function() {
	var guan = $("#guan").val();
	var grad=$("#grad");
	grad.append("<option value="+guan+">"+guan+"</option>");

	$("#butt").click(function(){
		
		var biao = $("#biao").val();
		var x_url = $("#x_url").val();
		var miao = $("#miao").val();

		
		$("#guan1").val(guan);
		 $("#biao1").val(biao);
		 $("#x_url1").val(x_url);
		 $("#miao1").val(miao);
		 var grad1=$("#grad1");
		grad1.append("<option value="+guan+">"+guan+"</option>");

		$.ajax({
			type : 'post',
			url : 'addbiao',
			data : {
				'guan' : guan,
				'biao':biao,
				'x_url':x_url,
		        'miao':miao
			},
			dataType : 'json',

			success : function(result) {
				
			}

		});
		
	/* ajax结束 */
	});
	

$("#guan1").change(function() {
	var guan1 = $("#guan1").val();
	var grad1=$("#grad1");
	grad1.append("<option value="+guan1+">"+guan1+"</option>");

	$("#butt1").click(function(){
		var guan1 = $("#guan1").val();
		var biao1 = $("#biao1").val();
		var x_url1 = $("#x_url1").val();
		var miao1 = $("#miao1").val();

		$("#guan2").val(guan1);
		 $("#biao2").val(biao1);
		 $("#x_url2").val(x_url1);
		 $("#miao2").val(miao1);
		 
		 var grad2=$("#grad2");
		grad2.append("<option value="+guan+">"+guan+"</option>");
		grad2.append("<option value="+guan1+">"+guan1+"</option>");


		$.ajax({
			type : 'post',
			url : 'addbiao',
			data : {
				'guan' : guan1,
				'biao':biao1,
				'x_url':x_url1,
		        'miao':miao1
			},
			dataType : 'json',

			success : function(result) {
				
			}

		});
		
	/* ajax结束 */
	});
	
	});
	});
});

	</script>
</body>
</html>
